<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
		<meta content="yes" name="apple-mobile-web-app-capable">
		<meta content="black" name="apple-mobile-web-app-status-bar-style">
		<meta content="telephone=no" name="format-detection">
		<title></title>
		<link href="css/style.css" rel="stylesheet">
	</head>
	<body>
		<div class="main">
			<div class="container register">
				<div id="logo"><img class="fill" src="img/logo_2.png"></div>
				<form id="registForm">
					<div class="form-group">
						<input id="phonenum" type="number" placeholder="您的手机号">
					</div>
					<div class="form-group yz">
						<input id="yzcode" placeholder="您的验证码">
						<input class="btn getcode" type="botton" value="获 取 验 证 码"/>
					</div>
					<div class="form-group">
						<select id="city">
							<option value="">您所在的城市</option>
							<option value="北京">北京</option>
							<option value="上海">上海</option>
							<option value="成都">成都</option>
							<option value="广州">广州</option>
							<option value="深圳">深圳</option>
							<option value="其他">其他</option>
						</select>
					</div>
					<div class="form-group">
						<input id="name" placeholder="您的真实姓名">
					</div>
					<div class="form-group sex">
						<a class="radio man" data="male">
							男 士
							<input type="radio" value="male" name="gender"></input>
						</a>
						<a class="radio female" data="female">女 士
							<input type="radio" value="female" name="gender"></input>
						</a>
					</div>
					<div class="form-group begin">
						<input class="btn a" type="submit" value="开 始 挑 战"/>
					</div>
				</form>
			</div>
		</div>
	<script src="js/jquery.min.js"></script>
	<script>
        //性别选择
        $(".sex a").on('click',function(){
            $(this).addClass('on').siblings().removeClass('on');
            var data = $(this).attr('data');
            if(data == 'male'){
            $("input:radio[name='gender']").eq(0).attr("checked",true);
            }else{
                $("input:radio[name='gender']").eq(1).attr("checked",true);
			}
            alert($("input[name='gender']:checked").val());
        });

		/* 不用请删除
		var phonenum='',yzcode='',city='',name='',sex='';
		//获取验证码
        var countDown,time = 60;
		$('.getcode').on('click',function(){
		    if($(this).hasClass('disable')) return;
            phonenum = $('#phonenum').val();
            if(phonenum == ''){
                alert('请输入您的手机号')
			}else if(!isPoneAvailable(phonenum)){
                alert('请输入正确的手机号')
			}else{
                console.log('获取验证码');
                $(this).addClass('disable');
                countDown = setInterval(countDownFun,1000);
			}
		});
		function countDownFun(){
            time--;
            if(time > 0){
                $('.getcode').text(time+'s后重新获取');
            }else{
                clearInterval(countDown);
                $('.getcode').removeClass('disable');
                $('.getcode').text('获取验证码');
                time = 60;
            }
        }
		//判断手机号格式
        function isPoneAvailable(str) {
            var myreg=/^[1][3,4,5,7,8][0-9]{9}$/;
            if (!myreg.test(str)) {
                return false;
            } else {
                return true;
            }
        }
        //性别选择
        $(".sex a").on('click',function(){
			$(this).addClass('on').siblings().removeClass('on');
			sex = $(this).attr('data');
		});
		$('.begin a.btn').on('click',function(){
            phonenum = $('#phonenum').val();
            yzcode = $('#yzcode').val();
            city = $("#city option:selected").val();
            name = $("#name").val();
            if(phonenum == ''){
                alert('请输入您的手机号')
            }else if(!isPoneAvailable(phonenum)){
                alert('请输入正确的手机号')
            }else if(yzcode == ''){
                alert('请输入您收到的验证码')
            }else if(city == ''){
                alert('请选择您躲在的城市')
            }else if(name == ''){
                alert('请输入您的真实姓名')
            }else if(sex == ''){
                alert('请选择性别')
            }else{
                console.log('提交表单');
                window.location.href = 'jointeam.html';
            }
		});
		*/
	</script>
	</body>
</html>